package com.ht.common.core.enums;

import com.ht.common.core.annotation.EnumDictType;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 进出口标志
 * @author Administrator
 *
 */
@EnumDictType(dictType="sys_i_e_flag",dictName="进出口类型")
public enum IEPortEnum {
	IMPORT("I", "进口"),
	EXPORT("E", "出口");
	
	
	IEPortEnum(String code, String name) {
		this.code = code;
		this.name = name;
		
	}
	private final String code;
    private final String name;
	public String getCode() {
		return code;
	}
	public String getName() {
		return name;
	}

	public static List<Map<String, String>> getDictList() {
		return Arrays.asList(IEPortEnum.values()).stream().map(item -> {
					Map<String, String> map = new HashMap<>();
					map.put("code", item.getCode());
					map.put("name", item.getName());
					return map;
				})
				.collect(Collectors.toList());
	}

}
